<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page isELIgnored="false" %>
<html>
<head>
<title>Show Claims</title>
</head>

<body>
<%@ page errorPage="common/error.jsp" %>
<%@ include file = "common/header.jsp" %>

<a href="<c:url value="/claim/new" />">Create new claim</a> 

<h1 >Claim list</h1>

    <table border=1 >
        <thead>
            <tr>
                <th>Book title</th>
                <th>Book author</th>
                <th>Claim amount</th>
                <th>Executed</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach items="${claims}" var="claim">
                <tr>
                    <td><a href="${pageContext.request.contextPath}/claim/info?id=${claim.claimId}">${claim.book.title}</a></td>
                    <td>${fn:toUpperCase(claim.book.author)}</td>
                       <td>${claim.claimAmount}</td>
                       <td>${claim.executed}</td>
                </tr>
            </c:forEach>
        </tbody>
    </table>

<%@ include file = "common/footer.jsp" %>
</body>
</html>